<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
<style type="text/css">
input[type=checkbox]{padding:0px; margin:0px; text-align:right;width: 20px}
.div_input {
	width: 500px;
	height: 40px;
}
</style>
</head>
<body style="background: #f5f5f5">
<div class="main">
	<div class="weizhi">
	<c:if test="${empty trainType}">
		学员基础资料>>培训类型>>新增
	</c:if>
	<c:if test="${not empty trainType}">
		学员基础资料>>培训类型>>修改
	</c:if>
	</div>
	<div class="div_body" style="box-shadow: 0 0 5px #cccccc;">
		<div class="div_form">
			<form action="<%=path%>/DrivingSys/addOrUpdateTyainType" class="form" onsubmit="return submit2();">
			<c:if test="${empty trainType}">
				<div class="jczl">
						<div class="div_input">
							<span class="gn_name">编码&nbsp;:&nbsp;</span>
							<input type="text" name="fnumber" value="${fnumber}" readonly="readonly" style="color: gray;" id="fnumber">
						</div>
						<div class="div_input">
							<span class="gn_name">名称&nbsp;:&nbsp;</span>
							<input type="text" name="fnameL2" id="fnameL2">
                            <span class="required">必填</span>
						</div>
						<div class="div_input">
							<span class="gn_name">简称&nbsp;:&nbsp;</span>
							<input type="text" name="fsimplename" id="fsimplename">
						</div>
						<div class="div_input">
							<span class="gn_name">描述&nbsp;:&nbsp;</span>
							<input type="text" name="fdescriptionL2" id="fdescriptionL2">
						</div>
					</div>
				</c:if>
				
				<c:if test="${not empty trainType}">
				<div class="jczl">
						<input type="hidden" name="fid" value="${trainType.fid}" id="fid">
						<div class="div_input">
							<span class="gn_name">编码&nbsp;:&nbsp;</span>
							<input type="text" name="fnumber" value="${trainType.fnumber}" readonly="readonly" style="color: gray;" id="fnumber">
						</div>
						<div class="div_input">
							<span class="gn_name">名称&nbsp;:&nbsp;</span>
							<input type="text" name="fnameL2" id="fnameL2" value="${trainType.fnameL2}">
                            <span class="required">必填</span>
						</div>
						<div class="div_input">
							<span class="gn_name">简称&nbsp;:&nbsp;</span>
							<input type="text" name="fsimplename" id="fsimplename" value="${trainType.fsimplename}">
						</div>
						<div class="div_input">
							<span class="gn_name">备注&nbsp;:&nbsp;</span>
							<input type="text" name="fdescriptionL2" id="fdescriptionL2" value="${trainType.fdescriptionL2}">
						</div>
					</div>
				</c:if>
				<c:if test="${empty trainType}">
					<div class="div_tj" style="margin-left: 140px">
						<div>
                            <input type="submit" class="input_submit bc" value="" id="button_submit" style="margin-right: 30px;">
						</div>
						<div>
                            <input type="button" class="input_back fh" value="" onclick="back()"/>
						</div>
					</div>
				</c:if>
				<c:if test="${not empty trainType}">
					<div class="div_tj" style="margin-left: 140px">
						<div>
                            <input type="submit" class="input_submit bc" value="" id="button_submit" style="margin-right: 30px;">
						</div>
						<div>
                            <input type="button" class="input_back fh" value="" onclick="back()"/>
						</div>
					</div>
				</c:if>
			</form>
		</div>
	</div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp"%>
<script type="text/javascript">

$(document).ready(function(){
	var type = "${type}"
	if(type == null || type == ''){
		
	}else{
        editAlert();
	}
})
function back(){
    parent.closeSelectCard()

    //location = 'queryTrainType/look.action';
}

//阻止表单提交
function submit2(){
	var name = $("#fnameL2").val();
	if(name == null || name == ''){
        alert("名称不能为空!")
		return false
	}
    //提交后把提交变成不可用，可阻止表单重复提交
    $("input[type='submit']").attr("disabled", "disabled");
}
</script>

</html>